package com.taotao.web.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fasterxml.jackson.core.type.TypeReference;
import com.taotao.common.service.HttpClientService;
import com.taotao.web.pojo.Cart;
import com.taotao.web.threadlocal.UserThreadLocal;

@Service
public class CartService {

	@Autowired
	private HttpClientService httpClientService;

	/**
	 * 查询购物车记录
	 * 
	 * @return
	 */
	public List<Cart> queryCartList() {
		return this.httpClientService.doGet(
				"http://cart.taotao.com/api/cart/" + UserThreadLocal.get().getId() + ".html",
				new TypeReference<List<Cart>>() {
				});
	}
}
